import CryptoJS from "crypto-js";

const key = CryptoJS.enc.Utf8.parse("zkztyzpEt2hxMAccVPoSdw3qPoYR6Y91hB7i5cMC33s9Oti66Z");
const iv = CryptoJS.enc.Utf8.parse('d9enoZkxr9ql2qnCB4ob8CIoLgc1Br04qPBXfkYpMLzBsO28YC');

export const encrypt = (word) => {
    let srcs = CryptoJS.enc.Utf8.parse(word);
    let encrypted = CryptoJS.AES.encrypt(srcs, key, {iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7});
    return encrypted.ciphertext.toString();
}